//
//  Person.m
//  OC知识整理
//
//  Created by 林一 on 2019/9/28.
//  Copyright © 2019 Kangjiedeng. All rights reserved.
//  

// Runtime Runloop KVO KVC 原理和运用
// OC 的方法调用，其实是消息发送

#import "Person.h"
#import <objc/runtime.h>

@implementation Person

//
//+(BOOL)resolveInstanceMethod:(SEL)sel{
//    class_addMethod(self, sel, runingWithFriend, "");
//    return [super resolveInstanceMethod:sel];
//}
//
//void eat(){
//    NSLog(@"混编");
//}
//
//// id self, SEL _cmd
//// OC 方法调用会传递2个隐式参数，为什么会有这两个参数？
//void runingWithFriend(id self, SEL _cmd,NSString * objc){
//    NSLog(@"friend's name is %@",objc);
//}

// 测试runtime
+(void)eat{
    NSLog(@"源工程的eat");
}

+(void)runingWithFriend:(NSString *)name{
    NSLog(@"源工程的runningWithFriend");
}

-(void)instence{
    NSLog(@"源工程的实例方法");
}

//+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key{
//    // 手动触发KVO,需要自己实现 willchange 和 didchange
//    return NO;
//}


@end
